﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/PageMore.Master" AutoEventWireup="true" CodeBehind="PossyList.aspx.cs" Inherits="ZHDJ.Web.Portal.Possy.PossyList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    
    <script src="../../Resource/js/jquery/jquery.pagination.js"></script>
    <script type="text/javascript">
        var pageSize = 2, isBind = false;
        var paginationPara={
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: "上一页",
            next_text: "下一页",
            link_to: "javascript:void(0);"
        }
        var ViewModel= {
            qdate : ko.observableArray(),
            loadContacts : function (pageIndex) {
                $.get("PossyList.aspx", {
                    PageIndex: pageIndex,
                    PageSize: pageSize,
                    QueryText: $("#QueryText").val(),
                    r: (new Date()).getTime()
                },
                function (data) {
                    ViewModel.qdate(eval("(" + data + ")"));
                });
            }
        }
       
        function initPage() {
            $.get("PossyList.aspx", {DataCount: 1,QueryText: $("#QueryText").val(),r: (new Date()).getTime()},
                function (data) {
                    var totalCount = parseInt(data);
                    $("#pagination").pagination(totalCount, paginationPara);
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }
        }
        $(function () {
            initPage();
            $("#btnQuery").click(function() {
                initPage();
            });
        });
       
    </script>
    
    <script id="myTemplate" type="text/x-jquery-tmpl">
        <a href="PossyAppointment.aspx?category=PossyAppointment&module=PartyPossy&PossyID=${ID}" type="button" class="mybtn mybtn1" id="btnLogins" style="height: 32px;line-height: 32px;">预约</a>
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="hfTotalCount" runat="server" Value="10" />

    <div class="morequerybar" style="margin-bottom: 20px;">
        <table>
            <tr >
                <td><span>阵地名称：</span></td>
                <td>
                    <input class="text1 " id="QueryText" type="text" style="width: 200px" />
                </td>
                <td>
                    <button type="button" class="mybtn" id="btnQuery" style="height: 38px;line-height: 38px;margin-left:20px;">搜索</button>
                </td>
            </tr>
        </table>
    </div>
    <div id="datacontent">
        <!-- ko foreach: qdate -->
        <div class="cztable" style="margin-bottom: 20px;">
            <table class="table_b" border="0" cellspacing="0" cellpadding="0">
                <tr class="tr_b">
                    <td colspan="4"  class="td_b" >
                        <div style="line-height: 30px">
                            <span style="font-weight: 700; font-size: 14px; color: #333" data-bind="text:Name"></span>
                            <span style="float: right" data-bind="template: { name: 'myTemplate', data: $data }"></span>
                        </div>
                    </td>
                </tr>
                <tr class="tr_b" >
                    <th class="th_b">阵地地址：</th>
                    <td  class="td_b" colspan="3" data-bind="text: Address"></td>
                </tr>
                <tr class="tr_b">
                    <th  class="th_b">阵地交通：</th>
                    <td  class="td_b" colspan="3" data-bind="text: Traffic"></td>
                </tr>

                <tr class="tr_b">
                    <th class="th_b">阵地介绍：</th>
                    <td class="td_b" colspan="3" data-bind="text: Describe"></td>
                </tr>
                <tr class="tr_b">
                    <th class="th_b">接待时间：</th>
                    <td class="td_b" colspan="3" data-bind="text: VisitDaysName"></td>
                </tr>
            </table>
        </div>
          <!-- /ko -->
        </div>
  
    <div class="pagination">
        <div id="pagination">
        </div>
    </div>
</asp:Content>
